#ifndef __ERRLOG_H__
#define __ERRLOG_H__
#ifdef LANDI_PLAT
extern void debugsend(char* buff);
#endif
typedef enum
{
   DIAG_LOG_ERROR_MAJOR,  // ACTION NEEDED: MAJOR Error occured (e.g. Motor burned)
   DIAG_LOG_ERROR_MINOR,  // ACTION NEEDED: Minor Error Occured (e.g. Thermal protection motor)
   DIAG_LOG_WARNING,      // ATTENTION NEEDED: Strange thing occured
   DIAG_LOG_INFO,         // INFORMATION: Just to inform (e.g. Service Man logged in)
   DIAG_LOG_DEBUG_LOW,    // DEBUG: Low Debug, to help finding problems...
   DIAG_LOG_DEBUG_HIGH,   // DEBUG: HIGH Debug, let come out ALL loggings
} DIAG_LOG_TYPE;

typedef enum
{
    LOG_CLOSE,
    LOG_OPEN
} ENUM_LOG_CTRL_t;

#define DIAGLOG_ERR         __FILE__, __LINE__, DIAG_LOG_ERROR_MINOR
#define DIAGLOG_HERE        __FILE__, __LINE__

#if defined(CONFIG_LOG_MAJOR)
#define DIAGLOG_CRITICAL_ERR    __FILE__, __LINE__, DIAG_LOG_ERROR_MAJOR
#else
#define DIAGLOG_CRITICAL_ERR    DIAGLOG_ERR 
#endif
int dit_log_error(const char *p_filename, int line_marker, DIAG_LOG_TYPE diag_log_type, const char *p_format,...);
int dit_log_major_txn(const char *p_filename, int line_marker, DIAG_LOG_TYPE diag_log_type, const char *p_format, ...);

// add by ghC, 2014/03/11
#ifdef UI_CONFIG_DBG
    #define UI_PRC_DBG(p_filename, line_marker, diag_log_type, p_format, ...) dit_log_error(p_filename, line_marker, diag_log_type, p_format, ...);  
#else
    #define UI_PRC_DBG(p_filename, line_marker, diag_log_type, p_format, ...);
#endif

// add 2014/06/06
#define MAJOR_PRINT_FUN_NAME dit_log_error(DIAGLOG_CRITICAL_ERR, "Enter %s()", __FUNCTION__)
//#define MAJOR_LOG_ERROR(argv...) dit_log_error(DIAGLOG_CRITICAL_ERR, ##argv) 
//#define MAJOR_LOG_ERROR(argv...)   dit_log_error(DIAGLOG_CRITICAL_ERR, ##argv)

#endif
